<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='购物车',active='order'" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<header th:replace="back/header::headerFragment(${title},${active})"></header>
<link th:href="@{/back/css/cart.css}" rel="stylesheet" type="text/css"/>
<head>

</head>
<body class="fixed-left">
<div id="wrapper">
    <div th:replace="back/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">购物车</h4>
                    </div>
<!--                    <form class="cart_bg" id="cart" action="/order/toBuy" method="post">-->
<!--                        <th:block th:if="${#lists.isEmpty(shoppingCart.goodsList)}">-->
<!--                            <div class="list center">-->
<!--                                <h3>暂无商品，快去买买买吧！</h3>-->
<!--                            </div>-->
<!--                        </th:block>-->
<!--                        <th:block th:unless="${#lists.isEmpty(shoppingCart.goodsList)}">-->
<!--                            <div class="list center">-->
<!--                                <div class="top2 center">-->
<!--                                    <div class="sub_top fl">-->
<!--                                    </div>-->
<!--                                    <div class="sub_top fl">商品名称</div>-->
<!--                                    <div class="sub_top fl">单价</div>-->
<!--&lt;!&ndash;                                    <div class="sub_top fl">数量</div>&ndash;&gt;-->
<!--                                    <div class="sub_top fl">小计</div>-->
<!--                                    <div class="sub_top fr">操作</div>-->
<!--                                    <div class="clear"></div>-->
<!--                                </div>-->
<!--                                <th:block th:each="item : ${shoppingCart.goodsList}">-->
<!--                                    <input th:value="${item.id}" th:name="goodsId" type="checkbox">-->
<!--                                    <div class="content2 center">-->
<!--                                        <div class="sub_content fl ">-->
<!--                                        </div>-->
<!--                                        <div class="sub_content cover fl"><img th:src="@{${item.image}}"></div>-->
<!--                                        <div class="sub_content fl ft20" th:text="${item.title}">商品名称</div>-->
<!--                                        <div class="sub_content fl" th:text="${item.price+'元'}">1299元</div>-->
<!--&lt;!&ndash;                                        <div class="sub_content fl">&ndash;&gt;-->
<!--&lt;!&ndash;                                            <input class="goods_count" th:id="${'goodsCount'+item.cartItemId}" type="number"&ndash;&gt;-->
<!--&lt;!&ndash;                                                   th:onblur="'updateItem('+${item.cartItemId}+')'"&ndash;&gt;-->
<!--&lt;!&ndash;                                                   th:value="${item.goodsCount}" step="1" min="1"&ndash;&gt;-->
<!--&lt;!&ndash;                                                   max="5">&ndash;&gt;-->
<!--&lt;!&ndash;                                        </div>&ndash;&gt;-->
<!--                                        <div class="sub_content fl" th:text="${item.discount*item.price+'元'}">1299元</div>-->
<!--                                        <div class="sub_content fl"><a href="##" th:onclick="'deleteItem('+${item.id}+')'">×</a>-->
<!--                                        </div>-->
<!--                                        <div class="clear"></div>-->
<!--                                    </div>-->
<!--                                </th:block>-->
<!--                            </div>-->
<!--                        </th:block>-->
<!--                        <div class="pre_order mt20 center">-->
<!--                            <div class="tips fl ml20">-->
<!--                                <ul>-->
<!--                                    <li><a th:href="@{/index}">继续购物</a></li>-->
<!--                                    <li>|</li>-->
<!--                                    <div class="clear"></div>-->
<!--                                </ul>-->
<!--                            </div>-->
<!--                            <div class="order_div fr">-->
<!--                                <div class="order_total fl">合计：<span th:text="${shoppingCart.priceTotal}+'元'"></span></div>-->
<!--                                <div class="order_button fr">-->
<!--                                    <th:block>-->
<!--                                        <input class="order_button_d" type="submit"-->
<!--                                               value="去结算"/>-->
<!--                                    </th:block>-->
<!--                                </div>-->
<!--                                <div class="clear"></div>-->
<!--                            </div>-->
<!--                            <div class="clear"></div>-->
<!--                        </div>-->
<!--                    </form>-->
                    <form class="col-md-12"  action="/order/toBuy" method="post">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th></th>
                                <th>商品名称</th>
                                <th>单价</th>
                                <th>数量</th>
                                <th>小计</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="goods : ${shoppingCart.goodsList}">
                                <tr>
                                    <td>
                                        <input type="checkbox" th:value="${goods.id}" name="goodsId">
                                    </td>
                                    <td><img width="150px" height="150px" th:src="${goods.image}"><span th:text="${goods.title}"></span></td>
                                    <td><th:block th:text="${goods.price}"/></td>
                                    <td>1</td>
                                    <td th:text="${'￥'+goods.id+'元'}"></td>
                                </tr>
                            </th:block>
                            </tbody>
                        </table>
                        <p>合计：<span th:text="${shoppingCart.priceTotal}"></span></p>
                        <button type="submit" class="btn btn-primary">
                            立即购买
                        </button>
                    </form>
                </div>
                <div th:replace="back/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="back/footer :: footer"></div>
<script type="text/javascript">

//    function toBuy() {
//        var goodsList=$('#cart').serialize();
//        $.ajax({
//            url:'/order/toBuy',
//            type:'post',
//            success:function (result){
//
//            }
//
//        })
//    }
</script>
</body>
</html>